package test.ao4demo4;

public class Worker extends Person{
    private String unit;
    private int workAge;
    public Worker() {
    }
    public Worker(String name, String sex, int age, String nationality, String unit, int workAge) {
        super(name, sex, age, nationality);
        this.unit = unit;
        this.workAge = workAge;
    }
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    public int getAge() {
        return workAge;
    }
    public void setAge(int age) {
        this.workAge = workAge;
    }
    @Override
    public void work(){
        System.out.println("工人的工作是盖房子");
    }
}
